<html>
<head><meta charset="utf-8"><title>Running doctests in libcore · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html">Running doctests in libcore</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="196819913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196819913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Russell Cohen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196819913">(May 07 2020 at 19:32)</a>:</h4>
<p>I'm trying to run the libcore tests with:</p>
<div class="codehilite"><pre><span></span><code>./x.py test src/libcore --stage 0
</code></pre></div>


<p>The regular tests run fine, but then it errors with:</p>
<div class="codehilite"><pre><span></span><code>Doc-tests core
error: the `-Z unstable-options` flag must also be passed to enable the flag `crate-version`

error: test failed, to rerun pass &#39;--doc&#39;

command did not execute successfully: &quot;/home/russell/code/rust/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo&quot; &quot;test&quot; &quot;--target&quot; &quot;x86_64-unknown-linux-gnu&quot; &quot;-Zbinary-dep-depinfo&quot; &quot;-j&quot; &quot;8&quot; &quot;--release&quot; &quot;--features&quot; &quot;panic-unwind backtrace compiler-builtins-c&quot; &quot;--manifest-path&quot; &quot;/home/russell/code/rust/rust/src/libtest/Cargo.toml&quot; &quot;--doc&quot; &quot;-p&quot; &quot;core&quot; &quot;--&quot; &quot;--quiet&quot;
</code></pre></div>



<a name="196820144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196820144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196820144">(May 07 2020 at 19:34)</a>:</h4>
<p><code>RUSTFLAGS_BOOTSTRAP=-Zunstable-options ./x.py test src/libcore --stage 0</code> should work. It will likely cause a recompilation of everything though.</p>



<a name="196820178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196820178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196820178">(May 07 2020 at 19:34)</a>:</h4>
<p>You could also add <code>-Zunstable-options</code> here: <a href="https://github.com/rust-lang/rust/blob/0a675c5e02e6ecfda7d4e04aabd23a9935e0c4bf/src/bootstrap/builder.rs#L805" title="https://github.com/rust-lang/rust/blob/0a675c5e02e6ecfda7d4e04aabd23a9935e0c4bf/src/bootstrap/builder.rs#L805">https://github.com/rust-lang/rust/blob/0a675c5e02e6ecfda7d4e04aabd23a9935e0c4bf/src/bootstrap/builder.rs#L805</a></p>



<a name="196821647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196821647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Russell Cohen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196821647">(May 07 2020 at 19:47)</a>:</h4>
<p>thanks, works!</p>



<a name="196822681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196822681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Russell Cohen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196822681">(May 07 2020 at 19:57)</a>:</h4>
<p>hmmmm, actually not. it worked, but then I changed branches and it stopped working. I cleaned and ran it again and it still isn't working (same error)</p>



<a name="196823076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196823076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196823076">(May 07 2020 at 20:00)</a>:</h4>
<p>If you chose the edit <code>builder.rs</code> route, did you re-apply the changes after you switched?</p>



<a name="196823125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196823125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196823125">(May 07 2020 at 20:00)</a>:</h4>
<p>Otherwise I don't know</p>



<a name="196823198"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Running%20doctests%20in%20libcore/near/196823198" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Russell Cohen <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Running.20doctests.20in.20libcore.html#196823198">(May 07 2020 at 20:01)</a>:</h4>
<p>Ah, I just rebased on master and it works now</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>